package unix

import "errors"

type UnixRequest struct {
	Name      string `json:"name"`
	NameSpace string `json:"namespace"`
	Type      string `json:"type"`
}

func (req *UnixRequest) Validate() error {
	switch req.Type {
	case "pod":
		if req.Name == "" {
			return errors.New("empty name")
		}
		if req.NameSpace == "" {
			req.NameSpace = "default"
		}

		return nil
	default:
		return errors.New("type not support")
	}
}
